package com.jia.leetCode;

/**
 * 1529.灯泡开关IV
 *
 */
public class Pro1529 {
    public int minFlips(String target) {
        int change = 0;
        for(int i = 0; i < target.length(); i++) {
            if((change & 1) == 0 && target.charAt(i) == '1' || (change & 1) == 1 && target.charAt(i) == '0') {
                ++change;
            }
        }
        return change;
    }
}
